export const mapState = (arrList) => {
  let obj = {}
  for(let i=0;i<arrList.length;i++) {
    let stateName = arrList[i]
    obj[stateName] = function () {
      return this.$store.state[state]
    }
  }
  return obj
}

export const mapGetters = (arrList) => {
  let obj = {}
  for(let i=0;i<arrList.length;i++) {
    let stateName = arrList[i]
    obj[stateName] = function () {
      return this.$store.getters[state]
    }
  }
  return obj
}

export const mapMutations = (arrList) => {
  let obj = {}
  for(let i=0;i<arrList.length;i++) {
    let stateName = arrList[i]
    obj[stateName] = function (payload) {
      this.$store.commit(stateName, payload)
    }
  }
  return obj
}

export const mapActions = (arrList) => {
  let obj = {}
  for(let i=0;i<arrList.length;i++) {
    let stateName = arrList[i]
    obj[stateName] = function (payload) {
      this.$store.dispatch(stateName, payload)
    }
  }
  return obj
}